import 'package:favoritecate/core/services/Networking.dart';
import '../model/meal_model.dart';

class MealRequest{
  static Future<List<FYMealModel>> getMealData() async{
     final url = '/meal';
     final result = await NetworkingManager.request(url);
     //json to model
     final mealArray = result['meal'];
     List<FYMealModel> meals = [];
     for (var json in mealArray){
       meals.add(FYMealModel.fromJson(json));
     }
     return meals;
  }
}